#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=2e5+5,inf=1e16;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
int n,s,a[N],h[N],id[N],p[N];

inline bool cmp(int x,int y){
	return ((h[x]+s-1)/s-1)*a[x]<((h[y]+s-1)/s-1)*a[y];
}

signed main(){
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	n=read(),s=read();
	for(int i=1;i<=n;i++) a[i]=read(),h[i]=read();
	if(n<=10){
		for(int i=1;i<=n;i++) p[i]=i;
		int ans=inf;
		do{
			int g=s,res=0;
			for(int i=1;i<=n;i++){
				res+=((h[p[i]]+g-1)/g-1)*a[p[i]];
				g=max(g,a[p[i]]);
			}
			ans=min(ans,res);
		}while(next_permutation(p+1,p+1+n));
		printf("%lld",ans);
	}
	else{
		for(int i=1;i<=n;i++) id[i]=i;
		sort(id+1,id+1+n);
		int ans=0,g=s;
		for(int i=1;i<=n;i++){
			ans+=((h[id[i]]+g-1)/g-1)*a[id[i]];
			g=max(g,a[id[i]]);
		}
		printf("%lld",ans);
	}
	return 0;
}